# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-i18naddress
_pyname=google-i18n-address
pkgver=3.1.1
pkgrel=0
pkgdesc="Address validation helpers for Google's i18n address database"
url="https://github.com/mirumee/google-i18n-address"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-requests"
makedepends="py3-gpep517 py3-hatchling py3-installer py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mirumee/google-i18n-address/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7df537ec2f2f06246e1f77dc2eccb87aca30fb9251a3f32acb154b6ab5754f0525d8a06f1adee210f98bd49ace25b1e78075f5ef378ea0c410fcf08c3addd0b1  py3-i18naddress-3.1.1.tar.gz
"
